<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="/admin/plugin/layui/dist/css/layui.css" tppabs="http://res.layui.com/layui/dist/css/layui.css"  media="all">
    <script src="/admin/plugin/layui/dist/layui.js" charset="utf-8"></script>

    <script type="text/javascript" src="/admin/js-css/js/vue.min.js"></script>
    <script type="text/javascript" src="/admin/js-css/js/mx1.0.js"></script>
    <script type="text/javascript" src="/admin/js-css/js/mx1.0.1.js"></script>

    <title>数据字典录入</title>
</head>
<body>

<div id="app">
    <div class="layui-form-item">
        <label class="layui-form-label">数据字典名称</label>
        <div class="layui-input-block">
            <input type="text" name="code_name" required  lay-verify="required" placeholder="请输入数据字典名称" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label" >数据字典编码</label>
        <div class="layui-input-block">
            <input type="text" name="code_value"   placeholder="请输入数据字典编码" autocomplete="off" class="layui-input">
        </div>
    </div>

    <table id="demo" lay-filter="test"></table>

</div>

<script>
    var form = null;
    var $ = null;
    var table = null;
    var vm = new Vue({
        el: '#app',
        data: {
            columns:[],
            searchInputDtos:{}
        },
        created(){
            this.init();
        },
        methods:{
            init(){
                layui.use(['form','jquery','table'], function(){
                    form = layui.form;
                    $ = layui.jquery;
                    table = layui.table;

                    //可侧列表执行渲染
                    table.render({
                        id:"idTest",
                        elem: '#demo' //指定原始表格元素选择器（推荐id选择器）
                        ,height: "full-50" //容器高度
                        ,cols:[[{checkbox: true},
                            {field:"code_name",title: "字典名称"}
                            ,{field: "col_value",title:"字典值"}
                            ,{field: "pxh",title:"排序号"}
                            ,{field: "right",title:"操作",toolbar: '#barDemo'}]] //设置表头
                        ,url:"/admin/api/DataManagementController/list"
                        ,where:{orderBy:"pxh",tableId:"1",searchInputDtos: {code_id:{key:"code_id",type:"6",value:"是否"}}}
                        ,contentType: 'application/json'
                        ,method:"post"
                        ,page:true
                        ,toolbar: '.layui-btn-group'
                        ,request: {
                            pageName: 'pageNumber' //页码的参数名称，默认：page
                            ,limitName: 'pageSize' //每页数据量的参数名，默认：limit
                        }
                        ,parseData:function(res){
                            return {
                                "code": "0", //解析接口状态
                                "msg": res.msg, //解析提示文本
                                "count": res.data.total, //解析数据长度
                                "data": res.data.rows //解析数据列表
                            };
                        }
                        //,…… //更多参数参考右侧目录：基本参数选项
                    });

                });
            }
        }
    })

    function getData() {
        let data = vm.searchInputDtos;
        return data;
    }
</script>
</body>
</html>
